#include <iostream>
#include <cstdio>
using namespace std;
int main(){
    freopen("arena.in","r",stdin);
    freopen("arena.out","w",stdout);
    long long n,m,T;
    long long a[100000],c[100000],t[100000][3];
    cin >> n >> m;
    for (long long i = 0;i<n;i++){
        cin >> a[i];
    }
    for (long long i = 0;i<m;i++){
        cin >> c[i];
    }
    cin >> T;
    for (long long i = 0;i<T;i++){
        cin >> t[i][0] >> t[i][1] >> t[i][2] >> t[i][3];
    }
    fclose(stdin);
    fclose(stdout);
    return 0;
}
